<template>
<div class="app-container">
  <h2>订单数据展示</h2>
  <el-table v-loading="loading" :data="ordertotaldate" style="width: 100%" align="center">
    <el-table-column
      prop="sales"
      label="总销售额(/元)"
      width="180"

    >
    </el-table-column>
    <el-table-column
      prop="totalOrderNum"
      label="总订单数(/单)"
    >
    </el-table-column>

    <el-table-column
      prop="customerNum"
      label="总使用下单过用户(/位)"
    >
    </el-table-column>
    <el-table-column
      prop="comsales"
      label="较前一日销售额变化(/元)"
    >
    </el-table-column>

  </el-table>
<div class="sevendata">
  <h2>最近七天营业数据展示</h2>
  <el-table v-loading="loading" :data="orderservendate" style="width: 100%" align="center">
    <el-table-column
      prop="newdate"
      label="日期"
      width="180">
    </el-table-column>
    <el-table-column
      prop="daliyordernum"
      label="该天订单量(/单)"
      >
    </el-table-column>

    <el-table-column
      prop="comdaliyordernum"
      label="较前一天订单数对比(/单)"
      >
    </el-table-column>
    <el-table-column
    prop="daysales"
    label="该天总销售额(/元)"
   >
  </el-table-column>
  <el-table-column
    prop="comsales"
    label="较前一天销售额变化(/元)"
  >
  </el-table-column>
  </el-table>
</div>
</div>
</template>

<script>
import {listShow_Weeklyorder,listShow_order} from "@/api/order_date_chart/show_order_data_chart";

export default {
  name: "index",
    data() {
      return {
        loading: true,
        // 存放表格数据
        orderservendate: [],
        ordertotaldate:[],
        // 总条数
        total: 0,
        s:0

      }
    },
  created() {
    this.getOrderTotalData();
    this.getOrderWeeklydate();
  },
  methods:{
    getOrderWeeklydate(){
      const _this = this
      this.loading = true;
      listShow_Weeklyorder().then(
        (response) => {
          _this.orderservendate = response;
          _this.total = response.total;
          _this.loading = false;
          console.log(response)
      });

    },
    getOrderTotalData(){
      const _this=this;
      this.loading = true;
      listShow_order().then(
        (response) => {
          _this.ordertotaldate = response;
          _this.loading = false;
          console.log(response);
           // console.log(ordertotaldate);
        });
    }
  }




}
</script>

<style scoped>

</style>
